package com.coollang.smartbra.utils;

import android.graphics.Typeface;

import com.coollang.smartbra.base.MyApplication;

/**
 * @Auther: Timmy
 * @Data: 2017/6/20
 * @Fuction:
 */

public class FontsUtil {

    public static FontsUtil fontsUtil;


    private  Typeface numTypeface;
    private static Typeface charTypeface;

    public FontsUtil() {
        // 字体资源放在内存中，避免反复读取浪费资源
        numTypeface = Typeface.createFromAsset(MyApplication.getApplication().getAssets(),
                "fonts/enfragment_type.ttf");
        // charTypeface = Typeface.createFromAsset(mContext.getAssets(), "fonts/048-CAT978.ttf");
    }

    public static FontsUtil getInstance() {
        if (fontsUtil == null) {
            fontsUtil = new FontsUtil();
        }
        return fontsUtil;
    }

    public MyTypefaceSpan getMyCharTypefaceSpan() {
        return new MyTypefaceSpan(charTypeface);
    }

    public MyTypefaceSpan getMyNumTypefaceSpan() {
        return new MyTypefaceSpan(numTypeface);
    }
}
